package com.cxw.demo111.service.impl;

import com.cxw.demo111.mapper.EmpMapper;
import com.cxw.demo111.model.Emp;
import com.cxw.demo111.service.EmpService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class EmpServiceImpl implements EmpService {
    @Autowired
    private EmpMapper empMapper;

    @Override
    public PageInfo<Emp> findPage(Integer page, Integer rows) {
        PageHelper.startPage(page,rows);
        return new PageInfo<>(empMapper.selectAll());
    }
}
